<template>
  <el-dialog :visible.sync="visible" v-dialogDrag :title="title" class="tl-dialog" width="80%" height="80%" @open="open" @close="close" top="10px" :append-to-body="true" :modal-append-to-body="true">
    <div class="ref-dialog">
      <!-- 查询界面 -->
      <tl-list-search ref="search" :query-param="queryParam" @search="doQuery" :isDisplayDefaultSearch="false">
        <template slot="search">
          <el-form-item label="负责人">
            <el-input v-model="queryParam.qry_username" placeholder=""></el-input>
          </el-form-item>
        </template>
      </tl-list-search>
      <!-- 列表界面 -->
      <div class="Company">
        <!--表格渲染-->
        <el-table class="tl-table" ref="mainTable" height="30em" v-loading="loading" :data="datas" @selection-change="doSelectChange" @sort-change="doSortChange" @row-dblclick="doRowDbClick" row-key="id" border fit :row-class-name="doChangeRowClassName">
          <el-table-column type="selection" width="55px" fixed="left" v-if="!isSingleSelect"> </el-table-column>
          <!-- <el-table-column prop="dispdeptcommoncode1" label="创建部门" min-width="125px" sortable="custom" sort-by="deptcommoncode1" align="center" header-align="center"></el-table-column> -->
          <el-table-column prop="dispcurrentphase" label="机会点进展阶段" width="150px" sortable="custom" sort-by="currentphase" align="center" header-align="center"></el-table-column>
          <el-table-column prop="gardenername" label="负责人" width="150px" sortable="custom" sort-by="gardenername" align="center" header-align="center"></el-table-column>
          <el-table-column label="操作" width="80px" align="center" fixed="right" v-if="isSingleSelect === true">
            <template slot-scope="scope">
              <el-button type="text" icon="el-icon-finished" @click="doSelectData(scope.row[fieldDefaultKey])">选择</el-button>
            </template>
          </el-table-column>
        </el-table>

        <!-- 列表分页 -->
        <el-row class="pagebar" ref="pager">
          <el-pagination @size-change="doChangeSize" @current-change="doChangeIndex" :current-page="pageInfo.currentPage" :page-sizes="pageInfo.pageSizes" :total="pageInfo.totalCount" layout="total, sizes, prev, pager, next, jumper" background class="tl-table-pagination"> </el-pagination>
        </el-row>
      </div>
    </div>
    <div slot="footer" class="dialog-footer" v-if="isSingleSelect === false">
      <el-button type="text" @click="doCancelEdit">取消</el-button>
      <el-button type="primary" @click="doConfirm">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
/** mixins */
import { mixin_ref_list } from "@tapui/mixins/mixin_ref_list"
/** 子组件 */
import { validateNull } from "@tapui/utils/validate"

/** 工具类 */
import { queryDataCode } from "@tapui/api/dataCode"
import { getAction } from "tap-ui/src/utils/http"
/** VUE配置 */
export default {
  name: "TlCpCustomerCompanyRef",
  components: {},
  mixins: [mixin_ref_list],
  data() {
    return {
      description: "机会点选择参照页面",
      // 默认Key字段名
      fieldDefaultKey: "code",
      // 默认显示字段名
      fieldDefaultValue: "name",
      // url配置
      baseUrl: "/sd/project",
      url: {
        list: "/sd/project/queryChanceInfo"
      },
      natureList: [],
      // 排序参数
      sorterInfo: {
        sidx: "sortcode",
        sord: "asc"
      }
    }
  },

  methods: {
    /** 打开对话框 */
    open() {
      this.initRef()
    }
  }
}
</script>
<style lang="scss" scoped>
.ref-dialog {
  padding-bottom: 10px;
}
</style>
